package github.sf.fw.tools.db.impl.hive;


import github.sf.fw.tools.db.DSProperty;
import github.sf.fw.tools.db.TableDataReader;
import github.sf.fw.tools.db.impl.mysql.MysqlTableDataReader;
import github.sf.fw.tools.db.model.ResultRow;
import github.sf.fw.tools.db.model.TableDataWithPage;
import github.sf.fw.tools.db.model.TableInfo;

import java.sql.SQLException;
import java.util.List;

public class HiveTableDataReader implements TableDataReader {
    private final int PER_MAX_ROW = 10000;
    private final TableDataReader delegate;

    public HiveTableDataReader(DSProperty dsProperty) {
//        this.dsProperty = dsProperty;
        this.delegate = new MysqlTableDataReader(dsProperty);
    }

    @Override
    public TableDataWithPage loadTableData(TableInfo tableInfo, int page, int size) throws SQLException {
        return delegate.loadTableData(tableInfo, page, size);
    }

    @Override
    public TableDataWithPage loadTableDataWithScript(String queryScript, int page, int size) throws SQLException {
        return delegate.loadTableDataWithScript(queryScript, page, size);
    }

    @Override
    public List<ResultRow> loadTableData(TableInfo tableInfo) throws SQLException {
        return delegate.loadTableData(tableInfo);
    }

    @Override
    public List<ResultRow> loadTableDataWithScript(String querySql) throws SQLException {
        return delegate.loadTableDataWithScript(querySql);
    }
}
